<?php

/**
 * EmsDownloadSection form.
 *
 * @package    ems1
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class EmsDownloadSectionForm extends BaseEmsDownloadSectionForm
{
    public function configure()
    {
        unset ($this['section_id']);

        $this->widgetSchema['download_condition'] = new sfWidgetFormChoice(array(
            'choices'  => Doctrine_Core::getTable('EmsDownloadSection')->getConditions(),
            'multiple' => false,
            'expanded' => false,
        ));

        $this->validatorSchema['download_condition'] = new sfValidatorChoice(array(
            'choices' => array_keys(Doctrine_Core::getTable('EmsDownloadSection')->getConditions()),
        ));

        $this->widgetSchema['content_type_id'] = new sfWidgetFormChoice(array(
            'choices'  => Doctrine_Core::getTable('EmsDownloadSection')->getContentTypeOptions(),
            'multiple' => false,
            'expanded' => false,
        ));

        $this->validatorSchema['content_type_id'] = new sfValidatorChoice(array(
            'choices' => array_keys(Doctrine_Core::getTable('EmsDownloadSection')->getContentTypeOptions()),
        ));

        $this->widgetSchema->setLabels(
            array(
                'content_type_id' => 'Tipo de contenido',
                'download_condition' => 'Condición de descarga'
            )
        );
    }
}
